$(document).ready(function(){

$('.reg-form').submit(function(){
    var fName = $('#fName').notEmpty({errorClass: ".f-name-error"});
    var lName = $('#lName').notEmpty({errorClass: ".l-name-error"});
    var username = $('#username').notEmpty({errorClass: ".username-error"});
    var email = $('#email').notEmpty({errorClass: ".reg-email-error"});
    var company = $('#company').notEmpty({errorClass: ".reg-company-error"});
    var password = $('#password').notEmpty({errorClass: ".reg-password-error"});
    var country = $('#country').notEmpty({errorClass: ".country-error"});
    var empNum = $('#empNum').notEmpty({errorClass: ".emp-num-error"});
    var phone = $('#phone').notEmpty({errorClass: ".phone-error"});
    var rePassword =  $('#rePassword').notEmpty({errorClass: ".reg-rePassword-error"});
    var emailFormat =  $('#email').emailFormat({errorClass: ".reg-email-error"});
    var passwordEqual = $('#rePassword').equal({errorClass: ".reg-rePassword-error", equalTo: "#password"});
    var complex = $('#password').complexPassword();
    var phoneIsNum = $('#phone').isNumber({errorClass: ".phone-error"});
    var terms =$.fn.checkterms();
	
	if(!fName || !lName || !email || !username || !company || !password || !emailFormat || !rePassword || !passwordEqual || !empNum || !phone || !country || complex == "short" || complex == "weak" || !phoneIsNum || !terms)
        {return false;}
    else
        {return true;}
});

$('#password').keyup(function(){
    var complex = $('#password').complexPassword();
});

});
